home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / dos / grafik / cgazv5n3 / object.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1991-03-02  |  574 b   |  22 lines

  1. //******** Listing 4 ********************** OBJECT.HPP ***
  2. // A simple class to announce construction and destruction
  3. // (c) C Gazette. See listing 1 for usage.
  4. //********************************************************
  5.  
  6. #ifndef OBJECT_HPP_
  7. #define OBJECT_HPP_
  8. #include <stdio.h>
  9.  
  10. class object {
  11.   char tag;  // to indicate which object this is
  12. public:
  13.   object(char tg = '-') : tag(tg) {
  14.     printf("creating %c\n", tag);
  15.   }
  16.   void print() { printf("object %c\n", tag); }
  17.   ~object() {
  18.     printf("destroying %c\n", tag);
  19.   }
  20. };
  21.  
  22. #endif // OBJECT_HPP_